<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page session="true"%>
<%@page import="com.webapp.model.User"%>
<% 
	User user = (User)session.getAttribute("UserObject");
	if(user != null)
		System.out.println(user.getUserName());
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GARS - Upload Page</title>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<style>
	body { font-size: 95%; font-family: 'Open Sans'; padding:0; margin:0; background-color:#fff;}
	h1 { padding:0; margin:0; }
	h2 { padding:0; margin:0; }
	.sign_on_btn { background-color: #CC0000; color: #fff; border: 1px solid #990000; padding: 5px; cursor:pointer!important;}
	.sign_on_btn:hover { background-color:red; }
	.txtbox { background-color:#fff; border: 1px solid #ccc; width: 200px; }<br />
	.txtbox:focus { border: 1px soild #CC0000; }
	a { color: blue; }
	#top_of_site { padding: 5px;color: #333; background-color: #333; color:#fff; border: 1px solid #000;}
	#top_of_site h1 { padding:0; margin:0; font-size: 90%; }
	#wrapper { width: 900px; margin: 0px auto 0px auto; padding: 15px; }
	#login {  width: 340px; margin: 0px auto 0px auto; padding: 10px;background-color: #333; color:#fff; border: 1px solid #000; }
	.error { display:none; color:red; }
</style>

<script type="text/javascript" src="https://www.google.com/jsapi?key=INSERT-YOUR-KEY"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script language="Javascript" type="text/javascript">
    		//<![CDATA[
			google.load("jquery", "1.6.4", {uncompressed:true});
			google.load("jqueryui", "1.8.16", {uncompressed:true});			
    		function OnLoad() {
				$(document).ready(function() {
					
					$.getQuery = function( query ) {
						query = query.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
						var expr = "[\\?&]"+query+"=([^&#]*)";
						var regex = new RegExp( expr );
						var results = regex.exec( window.location.href );
						if( results != null ) {
							return results[1];
							return decodeURIComponent(results[1].replace(/\+/g, " "));
						} 
					};
					
					var query = $.getQuery('upload');
					if(query != "" && query != null) {
						$('.error').slideDown('fast', function() {
							$('.error').text("Oops! Invalid login credentials! You made an error! =) ");
						});
					}
					
					if(query == "true") {
						$('.error').slideDown('fast', function() {
							$('.error').text("Upload Successful :) ");
						});
					}
					
					if(query == "false") {
						$('.error').slideDown('fast', function() {
							$('.error').text("There was an error uploading your file GASP!");
						});
					}
					
				});
			}
    		
    		google.setOnLoadCallback(OnLoad);
    		//]]>
    	</script>
    	<script>
    	function checkForm(form){
			var x = form.userNameID.value;
			var y = form.passwordID.value;
			if(x == "" || y == "") {
				$('.error').slideDown('fast', function() {
					$('.error').text("Oops don't leave any blank fields!");
				});
				return false;
			}
		}
    	</script>
</head>

<body>
		<div id="top_of_site">
    		<h1>Graduate Application Review System (GARS) </h1>
    	</div>
	<div id="wrapper">
    
    	<div id="info_bar">
        </div>
        
        <div id="content">
        <!-- this of course will end the JSP include page for the top of website because only content will change-->
        	<h4 class="error">Error:</h4>
        	<div id="login">
            	
            	
            	<h2 style="margin:0; padding:0;">Upload AY File:</h2><br/>
            	<form id="uploadForm" name="uploadAYForm" action="Upload.do"  method="post" enctype="multipart/form-data">
            		<input type="hidden" name="ay" value="ay"/>
                	<table align="center" cellpadding="10">
                    	<tr>
                        	<td><strong>Please specify a file, or a set of files:</strong><br/>
                        	<input type="file" name="uploadFile" class="txtbox"/></td>
                     	</tr>
                     	<tr>
                     		<td><strong>Map File: </strong><br/><input type="file" name="uploadMapFile"  class="txtbox"/></td>
                     	</tr>
                     	<tr>
                     		<td><input type="checkbox" value="MS" name="MS"/>Masters <input type="checkbox" value="PHD" name="PHD"/>PHD</td>
                     	</tr>
                         <tr>
                        	<td><input type="submit" value="Upload" id="signOnBtn" class="sign_on_btn" onclick="return checkForm(this.form)"/></td>
                        </tr>
                    </table>
                </form>
                </div>
                
                <br/>
                
                <div id="login">
                <h2 style="margin:0; padding:0;">Upload OT File:</h2><br/>
            	<form id="uploadForm" name="uploadOTForm" action="UploadOTS.do"  method="post" enctype="multipart/form-data">
            		<input type="hidden" name="ot" value="ot"/>
                	<table align="center" cellpadding="10">
                    	<tr>
                        	<td><strong>Please specify a file, or a set of files:</strong><br/><input type="file" name="uploadFile" class="txtbox"/></td>
                        	
                     	</tr>
                     	<tr>
                     		<td><strong>Map File: </strong><br/><input type="file" name="uploadMapFile"  class="txtbox"/></td>
                     	</tr>
                         <tr>
                        	<td><input type="submit" value="Upload" id="signOnBtn" class="sign_on_btn" onclick="return checkForm(this.form)"/></td>
                        </tr>
                    </table>
                </form>
                </div>
                
                <br/>
                <div id="login">
                <h2 style="margin:0; padding:0;">Upload PDF File:</h2><br/>
            	<form id="uploadForm" name="uploadPDFForm" action="UploadPDF.do"  method="post" enctype="multipart/form-data">
            		<input type="hidden" name="pdf" value="pdf"/>
                	<table align="center" cellpadding="10">
                    	<tr>
                        	<td><strong>Please specify a file, or a set of files:</strong><br/>
                        	<input type="file" name="uploadFile"  class="txtbox"/></td>
                     	</tr>
                         <tr>
                        	<td><input type="submit" value="Upload" id="signOnBtn" class="sign_on_btn" onclick="return checkForm(this.form)"/></td>
                        </tr>
                    </table>
                </form>
                </div>
                <br/>
                <div id="login">
                <h2 style="margin:0; padding:0;">Upload PDF ZIP Files:</h2><br/>
            	<form id="uploadForm" name="uploadZIPForm" action="UploadPDFS.do"  method="post" enctype="multipart/form-data">
            		<input type="hidden" name="zip" value="zip"/>
                	<table align="center" cellpadding="10">
                    	<tr>
                        	<td><strong>Please specify a file, or a set of files:</strong><br/><input type="file" name="uploadFile"  class="txtbox"/></td>
                     	</tr>
                         <tr>
                        	<td><input type="submit" value="Upload" id="signOnBtn" class="sign_on_btn" onclick="return checkForm(this.form)"/></td>
                        </tr>
                    </table>
                </form>
                </div>
            </div>
            
        <!-- this will start the JSP include page for the bottom of the website because it will never change-->
        </div>
        
        <div id="footer">
			
        </div>
    </div>
</body>
</html>
